<?php

function run_menu_app($action = 'list') {
	switch ($action) {
	case 'create':
		require_once APP_PATH . '/' . APP_ADMIN_NAME . '/menu/create.php';
		break;
	case 'delete':
		require_once APP_PATH . '/' . APP_ADMIN_NAME . '/menu/delete.php';
		break;
	case 'quick_create':
		require_once APP_PATH . '/' . APP_ADMIN_NAME . '/menu/quick_create.php';
		break;
	case 'json':
		require_once APP_PATH . '/' . APP_ADMIN_NAME . '/menu/json.php';
		break;
	case 'list':
	default:
		$action = 'list';
		require_once APP_PATH . '/' . APP_ADMIN_NAME . '/menu/list.php';
		break;
	}
	if (function_exists('menu_' . $action . '_action')) {
		call_user_func('menu_' . $action . '_action');
	}
}